import Taro,{ Component } from "@tarojs/taro";
import { AtTabs,AtTabsPane } from "taro-ui";
import Film from "./AtTab/Film";  //豆瓣电影
import MovieNetwork from "./AtTab/movieNetwork"; //gitHub

export default class Home extends Component {
  state = {
    current: 0,
  }
  handleClick (value) {
    this.setState({
      current: value
    })
  }
  render(){
    const tabList = [{ title: '干货集中营' }, { title: '电影' }]
    //电影(时光网)
    return (
      <AtTabs current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
        <AtTabsPane current={this.state.current} index={0} >
          <Film/>
        </AtTabsPane>
        <AtTabsPane current={this.state.current} index={1}>
          <MovieNetwork/>
        </AtTabsPane>
      </AtTabs>
    )
  }
}
